package cn.wolfcode.trip.admin.controller;

import cn.wolfcode.trip.base.query.UserQueryObject;
import cn.wolfcode.trip.base.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/user")
public class UserController {
    //注入用户业务层的方法
    @Autowired
    private IUserService userService ;

    /**
     * 跳转后台用户的管理界面
     */
    @RequestMapping("/list.do")
    public String list(Model model, @ModelAttribute("qo") UserQueryObject queryObject){
        //接收到请求的参数，调用查询方法
        model.addAttribute("pageInfo",userService.query(queryObject));
        //跳转到指定的页面
        return "user/list" ;
    }
}
